home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -serious- / comms / other / novia / src / novia_gui.c < prev    next >
C/C++ Source or Header  |  1999-12-06  |  38KB  |  1,272 lines

  1. #define NOVIA_GUI_VERSION "$VER: NOVIA GUI-MUI-Frontend V0.13  ["__DATE__" "__TIME__"]"
  2. #define PROGTYPE_NOVIA_GUI
  3. #include <libraries/mui.h>
  4. #include <libraries/gadtools.h>
  5. #include <clib/muimaster_protos.h>
  6. #include <clib/alib_protos.h>
  7. #include <clib/dos_protos.h>
  8. #include <clib/exec_protos.h>
  9. #include <clib/asl_protos.h>
  10. #include <clib/icon_protos.h>
  11. #include <clib/graphics_protos.h>
  12. #include <clib/intuition_protos.h>
  13. #include <clib/gadtools_protos.h>
  14. #include <clib/utility_protos.h>
  15. #include <pragma/muimaster_lib.h>
  16. #include <pragma/exec_lib.h>
  17. #include <pragma/noviasys_lib.h>
  18. #include <stdlib.h>
  19. #include <stdio.h>
  20. #include <novia/novia_userdata.h>
  21. #include <novia/novia_userlist.h>
  22. #include <novia/novia_gui.h>
  23. #include <novia/novia_config.h>
  24. #include <novia/novia_misc.h>
  25. #include <novia/novia_global.h>
  26. #include <novia/novia_funcs.h>
  27. #include <novia/novia_userdata.h>
  28. #include <exec/memory.h>
  29. #include <libraries/iffparse.h>
  30. #include <dos/stdio.h>
  31.  
  32. #include "novia_gui_data.h"
  33. #include "novia_baseview_data.h"
  34.  
  35. #define TESTTEXT "Testtext for Mailtext CustomClass\n\n*Bold* /Italics/ _Underline_ #Coloured# _/*Combination*/_\n\n\nQuoted Text:\n\n1>2>3>4>5> *Bold* /Italics/ _Underline_ #Coloured#\n\nURLs: http://home.pages.de/~Mailtext/\n\nTo clear things up a bit: (let + be *, /, _ or #)\n\n   +Text+\n   ^    ^\n   |    |\n   |    +- the terminating char\n   |\n   +- the introducing char\n\n-- \nolf@gmx.de"
  36.  
  37. #define ID_ActionURL   1
  38. #define ID_ActionEMail 2
  39.  
  40. //#include <mui/demo.h>
  41.  
  42. #include <mui/Mailtext_mcc.h>
  43. #include <mui/NListview_mcc.h>
  44.  
  45. #include <dos/rdargs.h>
  46.  
  47. //#define DEBUG
  48.  
  49. struct MyNode {
  50.     struct MyNode     *ln_Succ;
  51.     struct MyNode    *ln_Pred;
  52.     UBYTE            ln_Type;
  53.     BYTE            ln_Pri;
  54.     BYTE             *ln_Name;
  55.     ULONG            IPNumber;
  56. };
  57.  
  58. #include "mcpp:lib/mui.c"
  59. #define REG(x) register __ ## x
  60.  
  61. //#define ASM
  62. //#define SAVEDS
  63.  
  64. char VER[]="$VER: NOVIA GUI-MUI-Frontend V0.14  ("__DATE__" "__TIME__")";
  65.  
  66. extern void GetX(Object *object,APTR pointer,ULONG ulong);
  67. extern BOOL MainPortConfigToGUI(MainPortConfig *config);
  68. extern BOOL GUIToMainPortConfig(MainPortConfig *config);
  69. extern BOOL ClientConfigToGUI(ClientConfig *config);
  70. extern void GUIToClientConfig(ClientConfig *config);
  71. extern void INet_POP3ServerToGUI(INet_POP3Server *server);
  72. extern void INet_LocalMailServerToGUI(INet_LocalMailServer *server);
  73. extern void GUIToINet_POP3Server(INet_POP3Server *server);
  74. extern void GUIToINet_LocalMailServer(INet_LocalMailServer *user);
  75. extern void INet_LocalUserToGUI(INet_MailUser *user);
  76. extern void GUIToINet_LocalUser(INet_MailUser *user);
  77. extern void EventToGUI(struct Event *event);
  78. extern void GUIToEvent(struct Event *event);
  79. extern void ExecuteEvent(Event *event);
  80. void UpdateBaselist(char *filename);
  81. void ParrentBaselist();
  82.  
  83.  
  84. ULONG ScreenmodeToStr(REG(a2) Object *object,REG(a1) ScreenModeRequester *asl);
  85. LONG DisplayListcport(REG(a2) char **array,REG(a1) struct PortData *cport2); 
  86. LONG DisplayListcportmin(REG(a2) char **array,REG(a1) struct PortData *cport2);
  87. LONG DisplayListudata(REG(a2) char **array,REG(a1) struct UserNode *udata);
  88. LONG DisplayListPOP3Server(REG(a2) char **array,REG(a1) INet_POP3Server *udata);
  89. LONG DisplayListLocalMailServer(REG(a2) char **array,REG(a1) INet_LocalMailServer *udata);
  90. LONG DisplayListMailserverUpdate(REG(a2) char **array,REG(a1) INet_LocalMailServer *udata);
  91. LONG DisplayListMailserverUser(REG(a2) char **array,REG(a1) struct INet_MailUser *newuser);
  92. LONG DisplayListPOP3Update(REG(a2) char **array,REG(a1) struct INet_POP3Server *server);
  93. LONG DisplayListPOP3Remove(REG(a2) char **array,REG(a1) struct INet_POP3Server *server);
  94. LONG DisplayListEvent(REG(a2) char **array,REG(a1) struct Event *event);
  95. LONG DisplayListEventRemove(REG(a2) char **array,REG(a1) struct Event *event);
  96. LONG DisplayListEventUpdate(REG(a2) char **array,REG(a1) struct Event *event);
  97.  
  98. void ClearEntry_List(struct List *list);
  99. void UserDataToGUI(UserData *udata);
  100. void GUIToUserData(UserData *udata);
  101. void RedrawEventList();
  102.  
  103. void GroupAddDate();
  104. void GroupRemDate();
  105. void GroupAddMonth();
  106. void GroupRemMonth();
  107.  
  108.  
  109. extern void SaveEvents();
  110.  
  111. BOOL gui_SendGUIMsg(LONG msgid,APTR data);
  112. extern void ReturnGUIMsg(GUIMsg *msg);
  113. extern void FreeGUIMsg(GUIMsg *msg);
  114. //extern void DoMethods(ObjApp *);
  115. void RemoveEntry_List(struct List *list);
  116. ULONG ConvertString(Object *object);
  117. void Read_Subboard(ItemHeader *header);
  118. extern void InsertMessageHeader(APTR List,char *header, char *text);
  119. extern Date actualdate;
  120.  
  121. //struct Library * MUIMasterBase=NULL;
  122. struct PortData *mport=NULL;                                        // internal use
  123. struct ObjApp * App = NULL;                                     // Application object
  124. struct PortData *edit_cport=NULL;
  125. struct UserData *edit_udata=NULL;
  126. ULONG  MaintanceScreenModeID=0;
  127. ULONG  ClientScreenModeID=0;
  128.  
  129. extern MainPortConfig *mainportconfig;
  130. extern struct MsgPort *GUIPort; // MsgPort of this Programm
  131. extern struct MsgPort *MainGUIPort;                     // MsgPort from MainPort for GUI-Msgs.
  132. extern ULONG  numberofclients;
  133. extern struct List *client_list;
  134. extern struct GUIFrontend guifrontend;
  135.  
  136. //struct MinList  LocalMailServerList;
  137. struct INet_LocalMailServer    *current_LocalMailServer=NULL;
  138. struct INet_MailUser                *current_MailUser=NULL;
  139. struct Event                        *current_event=NULL;
  140. ULONG    LocalMailServers=0;
  141.  
  142. //struct MinList  POP3ServerList;
  143. struct INet_POP3Server            *current_POP3Server=NULL;
  144. ULONG    POP3Servers=0;
  145.  
  146. ULONG State=2;
  147. List  dirlist;
  148. List    itemlist;
  149.  
  150. struct MyNode *currentdir=0;
  151. ULONG dircounter=0;
  152. ULONG itemcounter=0;
  153. char grp_date=FALSE;
  154. char grp_month=FALSE;
  155. char reminder_interval=TRUE;
  156. char datetype_space=FALSE;
  157.  
  158. char Baseviewstring[150];
  159.  
  160. char *PStatus(BYTE Status)
  161. {
  162.     switch (Status)
  163.     {
  164.     case 0:
  165.         return "Port is closed";
  166.         break;
  167.     case 1:
  168.         return "Port is offline";
  169.         break;
  170.     case 2:
  171.         return "online, waiting for call";
  172.         break;
  173.     case 3:
  174.         return "online, carrier detected";
  175.         break;
  176.     case 4:
  177.         return "online, user has login";
  178.         break;
  179.     }
  180.     return 0;
  181. }
  182.  
  183. void gui_CloseIt(char error_code, char *error_text)
  184. {
  185.     ULONG counter;
  186.     UserNode *next;
  187.     BOOL quit=FALSE;
  188.     struct  GUIMsg *msg;
  189.     if (error_code)
  190.         printf("guifrontend error: %s\n",error_text);
  191.     if (edit_udata)FreeVec(edit_udata);
  192.     if (App)DisposeApp(App);
  193. //    if (MUIMasterBase)CloseLibrary(MUIMasterBase);
  194.     if (GUIPort)DeleteMsgPort(GUIPort);
  195.     GUIPort=NULL;
  196.     guifrontend.GUIOpen=FALSE;
  197.    Exit((int)error_code);
  198. }
  199.  
  200. void gui_main()
  201. {
  202.     BOOL    running = TRUE;
  203.     ULONG   signal;
  204.     ULONG   counter;
  205.     ULONG   clientlistcounter=0;
  206.     BOOL    quit = FALSE;
  207.     struct  GUIMsg *msg;
  208.     ULONG   ulong;
  209.     APTR    old_hide;
  210.     ULONG   result=0;
  211.     struct List_Entry *entry;
  212.     char    IPNumber[4];
  213.     char    *itsme;
  214.     APTR    address;
  215.     char    *buf;
  216.     struct  PortData2 *nc;
  217.     struct  PortData  *cport2=NULL;
  218.     struct  UserNode  *usernode;
  219.     char      buffer[256];
  220.  
  221.     /************************************************************************/
  222.     /***                          Open Resources                          ***/
  223.     /************************************************************************/
  224.  
  225.     NewList(&dirlist);
  226.     NewList(&itemlist);
  227.  
  228.     GUIPort=CreateMsgPort();
  229.     if (!GUIPort)gui_CloseIt(20,"Can't create GUI-MsgPort");
  230.     GUIPort->mp_Node.ln_Name="NoviaGUI-Frontend_Port";
  231.  
  232. //    if (!(MUIMasterBase = OpenLibrary(MUIMASTER_NAME,0)))
  233. //        gui_CloseIt(20,"Can't open muimaster.library");
  234.  
  235.     if (!(MUIMasterBase))
  236.         gui_CloseIt(20,"Can't open muimaster.library");
  237.  
  238.     if (!(App = CreateApp()))
  239.         gui_CloseIt(20,"Can't create Application");
  240. //    GroupAddDate();
  241. //    GroupAddMonth();
  242.     set(App->GR_REMINDER_DATETYPE_MONTHLY,MUIA_ShowMe,FALSE);     // show SerialConfig 
  243.     set(App->GR_REMINDER_DATETYPE_MONTHLY,MUIA_ShowMe,TRUE);     // show SerialConfig 
  244.  
  245.     set(App->GR_REMINDER_DATETYPE_DATE,MUIA_Disabled,FALSE);
  246.     set(App->STR_REMINDER_ENDDATE,MUIA_Disabled,TRUE);
  247.     set(App->GR_REMINDER_DATETYPE_MONTHLY,MUIA_Disabled,TRUE);
  248.  
  249.     grp_date=TRUE;
  250.     grp_month=FALSE;
  251.     
  252.  
  253.     if (!(edit_udata=AllocVec(sizeof(UserData),MEMF_ANY|MEMF_CLEAR)))
  254.         gui_CloseIt(20,"Not anouth memory");
  255.  
  256.     /************************************************************************/
  257.     /***               Search for MainPort and get structures             ***/
  258.     /************************************************************************/
  259.  
  260.     old_hide=App->GR_LOCAL;                         // save actual show group ClientConfig->Network-Config
  261.     set(App->GR_LOCAL,MUIA_ShowMe,TRUE);     // show SerialConfig 
  262.  
  263.     /************************************************************************/
  264.     /***                              Mainloop                            ***/
  265.     /************************************************************************/
  266.  
  267. //      LV_Client_List
  268. //      LV_SS_Clients
  269.  
  270.     Delay(5);
  271.     mport=guifrontend.mport;
  272.     nc=(PortData2 *)client_list->lh_Head;
  273.     while (nc->port_node.ln_Succ)
  274.     {
  275.         DoMethod(App->LV_Client_List, MUIM_List_Insert, &nc->port_address, 1, MUIV_List_Insert_Bottom);
  276.         DoMethod(App->LV_SS_Clients, MUIM_List_Insert, &nc->port_address, 1, MUIV_List_Insert_Bottom);
  277.         nc=(PortData2 *)nc->port_node.ln_Succ;
  278.     }
  279.  
  280.     for (ulong=1; ulong<mport->UL.UserEntrys; ulong++)
  281.     {
  282.         usernode=&mport->UL.utable[ulong];
  283.        DoMethod(App->LV_SS_Users, MUIM_List_Insert, &usernode, 1, MUIV_List_Insert_Bottom);
  284.        DoMethod(App->LV_SS_TCP_MAILBOX_USERS_NAME, MUIM_List_Insert, &usernode, 1, MUIV_List_Insert_Bottom);
  285.     }
  286.  
  287.     {
  288.         struct Event *event=(Event *)mainportconfig->EventList.mlh_Head;
  289.         while (event->ln_Succ)
  290.         {
  291.             DateToString(buffer,&event->BeginDate,0);
  292.             DoMethod(App->LV_REMINDER, MUIM_List_Insert, &event, 1, MUIV_List_Insert_Bottom);
  293.             event=(Event *)event->ln_Succ;
  294.         }
  295.     }
  296.  
  297.  
  298.     {
  299.         struct INet_LocalMailServer *server=(INet_LocalMailServer *)mainportconfig->LocalMailServerList.mlh_Head;
  300.         while (server->ln_Succ)
  301.         {
  302.             DoMethod(App->LV_SS_TCP_MAILBOX_HOSTS, MUIM_List_Insert, &server, 1, MUIV_List_Insert_Bottom);
  303.             server=(INet_LocalMailServer *)server->ln_Succ;
  304.         }
  305.     }
  306.  
  307.     {
  308.         struct INet_POP3Server *server=(INet_POP3Server *)mainportconfig->POP3ServerList.mlh_Head;
  309.         while (server->ln_Succ)
  310.         {
  311.             DoMethod(App->LV_SS_TCP_POP_HOSTS, MUIM_List_Insert, &server, 1, MUIV_List_Insert_Bottom);
  312.             server=(INet_POP3Server *)server->ln_Succ;
  313.         }
  314.     }
  315.  
  316.  
  317.  
  318.  
  319.     DoMethods(App);         // Send Notifications to MUI
  320.  
  321.     MainPortConfigToGUI(mainportconfig);
  322.  
  323.  
  324.  
  325.  
  326.     sprintf(buffer,"%sroot",mport->sysdirs->sysdata);
  327.     UpdateBaselist(buffer);
  328.  
  329.     itemcounter=0;
  330.     dircounter=0;
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.     while (running && !guifrontend.ProgramClose)
  338.     {
  339.         result=DoMethod(App->App,MUIM_Application_Input,&signal);
  340.         if (result){
  341. #ifdef DEBUG
  342.         printf("resulltID:%d\n",result);
  343. #endif
  344.         switch (result)
  345.         {
  346.         case MUIV_Application_ReturnID_Quit:
  347.             if (MUI_RequestA(App->App, 0, 0,"System Request", "_Ok|_Cancel","Really Shutdown \nNoViA BBS System",0))
  348.                 gui_SendGUIMsg(GUIMSG_CLOSE_MAINPORT,0);                        
  349.             break;
  350.         case GUIID_SYSTEM_SERVICE:
  351.             MainPortConfigToGUI(mainportconfig);
  352.             set(App->WindowSystemService,MUIA_Window_Open,TRUE);
  353.             break;
  354.         case GUIID_BASE:
  355.             break;
  356.         case GUIID_FILEBASE:
  357.             break;
  358.         case GUIID_CHAT_CHANNELS:
  359.             break;
  360.         case GUIID_NEWS:
  361.             break;
  362.         case GUIID_PFILES:
  363. /*                      set(App->GR_WindowClientList,MUIA_Disabled,TRUE);               // first, hide all other windows
  364.             set(App->GR_WindowClientConfig,MUIA_Disabled,TRUE);
  365.             set(App->GR_WindowSystemService,MUIA_Disabled,TRUE);
  366.             set(App->WindowRegistration,MUIA_Window_Open,TRUE);
  367. */
  368.             break;
  369.         case GUIID_VOTES:
  370.             break;
  371.         case GUIID_AUSLASTUNG:
  372.             break;
  373.         case GUIID_GFILES:
  374.             break;
  375.         case GUIID_CLIENT_LIST:                 
  376.             break;
  377.         case GUIID_USERINFO:
  378.             break;
  379.         case GUIID_PORTINFO:
  380.             break;
  381.         case GUIID_MAILBOX:
  382.             break;
  383.         case GUIID_CH_CC_loadatstart:
  384.             break;
  385.         case GUIID_SELECT_ALL:
  386.             counter=TRUE;
  387.             DoMethod(App->LV_Client_List, MUIM_List_Select,
  388.                 MUIV_List_Select_All, MUIV_List_Select_On,&counter);
  389.             break;
  390.         case GUIID_SELECT_NOTHING:
  391.             counter=TRUE;
  392.             DoMethod(App->LV_Client_List, MUIM_List_Select,
  393.                 MUIV_List_Select_All, MUIV_List_Select_Off,&counter);
  394.             break;
  395.         case GUIID_CONFIG:
  396.             break;
  397.         case GUIID_ONLINE:
  398.             ulong = MUIV_List_NextSelected_Start;
  399.             for (;;)
  400.             {
  401.                 DoMethod(App->LV_Client_List, MUIM_List_NextSelected, &ulong);
  402.                 if (ulong == MUIV_List_NextSelected_End) break;
  403.                 DoMethod(App->LV_Client_List, MUIM_List_GetEntry, ulong, &cport2);
  404.                 gui_SendGUIMsg(GUIMSG_CLIENT_ONLINE,cport2);                                    
  405.             }
  406.             break;
  407.         case GUIID_OFFLINE:
  408.         ulong = MUIV_List_NextSelected_Start;
  409.             for (;;)
  410.             {
  411.                 DoMethod(App->LV_Client_List, MUIM_List_NextSelected, &ulong);
  412.                 if (ulong == MUIV_List_NextSelected_End) break;
  413.                 DoMethod(App->LV_Client_List, MUIM_List_GetEntry, ulong, &cport2);
  414.                 gui_SendGUIMsg(GUIMSG_CLIENT_OFFLINE,cport2);
  415.             }
  416.             break;
  417.         case GUIID_REMOVE:
  418.         ulong = MUIV_List_NextSelected_Start;
  419.             for (;;)
  420.             {
  421.                 DoMethod(App->LV_Client_List, MUIM_List_NextSelected, &ulong);
  422.                 if (ulong == MUIV_List_NextSelected_End) break;
  423.                 DoMethod(App->LV_Client_List, MUIM_List_GetEntry, ulong, &cport2);
  424.                 gui_SendGUIMsg(GUIMSG_CLIENT_UNLOAD,cport2);
  425.             }
  426.             break;
  427.         case GUIID_LOAD:
  428.             break;
  429.         case GUIID_ABOUT:
  430.         MUI_RequestA(App->App, 0, 0,"System Request","_Ok",
  431.             "NOVIA, Boud Bandit Software. V 0.00.06alpha \nCopyright ©1996-1999 by Thorsten Gehler/UFoP\nFrom: "__DATE__" "__TIME__,0);
  432.             break;
  433.         case GUIID_ABOUTMUI:
  434.             set(App->ABOUT,MUIA_Window_Open,TRUE);
  435.             break;
  436.         case GUIID_LOCKCONSULE:
  437.             set(App->GR_WindowClientList,MUIA_Disabled,TRUE);               // first, hide all other windows
  438.             set(App->GR_WindowClientConfig,MUIA_Disabled,TRUE);
  439.             set(App->GR_WindowSystemService,MUIA_Disabled,TRUE);
  440.             set(App->WindowLocked,MUIA_Window_Open,TRUE);
  441.             break;
  442.         case GUIID_RESTARTSERVER:
  443.             break;
  444.         case GUIID_RESETSERVER:
  445.             break;
  446.         case GUIID_QUIT:
  447.         if (MUI_RequestA(App->App, 0, 0,"System Request", "_Ok|_Cancel","Really Shutdown \nNoViA BBS System",0))
  448.             gui_SendGUIMsg(GUIMSG_CLOSE_MAINPORT,0);                        
  449.             break;
  450.         case GUIID_LOCALLOGIN:
  451.             break;
  452.         case GUIID_NONEWUSERS:
  453.             break;
  454.         case GUIID_BUSYALLPORTS:
  455.             break;
  456.         case GUIID_DISABLEBASE:
  457.             break;
  458.         case GUIID_CONFIGBASE:
  459.             break;
  460.         case GUIID_DISABLEUDBASE:
  461.             break;
  462.         case GUIID_CONFIGUDBASE:
  463.             break;
  464.         case GUIID_CHATCHANNELS:
  465.             break;
  466.         case GUIID_DISABLECC:
  467.             break;
  468.         case GUIID_DISABLENEWS:
  469.             break;
  470.         case GUIID_CONFIGNEWS:
  471.             break;
  472.         case GUIID_DISABLEPFILES:
  473.             break;
  474.         case GUIID_CONFIGPFILES:
  475.             break;
  476.         case GUIID_DISABLEGFILES:
  477.             break;
  478.         case GUIID_CONFIGGFILES:
  479.             break;
  480.         case GUIID_DISABLEVOTES:
  481.             break;
  482.         case GUIID_CONFIGCONFIG:
  483.             break;
  484.         case GUIID_BT_CC_Use:
  485.             GUIToClientConfig(&edit_cport->clientconfig);
  486.             gui_SendGUIMsg(GUIMSG_CLIENT_USE,edit_cport);
  487.             set(App->WindowClientConfig,MUIA_Window_Open,FALSE);
  488.             break;
  489.         case GUIID_BT_CC_Save:
  490.             GUIToClientConfig(&edit_cport->clientconfig);
  491.             gui_SendGUIMsg(GUIMSG_CLIENT_SAVE,edit_cport);
  492.             set(App->WindowClientConfig,MUIA_Window_Open,FALSE);
  493.             break;
  494.         case GUIID_BT_CC_Cancel:
  495.             gui_SendGUIMsg(GUIMSG_CLIENT_CANCEL,mport);
  496.             set(App->WindowClientConfig,MUIA_Window_Open,FALSE);
  497.             break;
  498.  
  499.         case GUIID_DC_CLIENT_LIST:
  500.             ulong = MUIV_List_NextSelected_Start;
  501.             DoMethod(App->LV_Client_List, MUIM_List_NextSelected, &ulong);
  502.             if (ulong!=MUIV_List_NextSelected_End)
  503.             {
  504.                 DoMethod(App->LV_Client_List, MUIM_List_GetEntry, ulong, &cport2);
  505.                 if (cport2->PortStatus==PORT_STATUS_CLOSE)
  506.                 {
  507. #ifdef DEBUG
  508.                     printf("online");
  509. #endif
  510.                     gui_SendGUIMsg(GUIMSG_CLIENT_ONLINE,cport2);
  511.                 }
  512.                 else
  513.                 {
  514. #ifdef DEBUG
  515.                     printf("tofront");
  516. #endif
  517.                     gui_SendGUIMsg(GUIMSG_CLIENT_TOFRONT,cport2);                                   
  518.                 }
  519.             }
  520.             break;
  521.         case GUIID_DC_SS_CLIENT_LIST:
  522.             ulong = MUIV_List_NextSelected_Start;
  523.             DoMethod(App->LV_SS_Clients, MUIM_List_NextSelected, &ulong);
  524.             if (ulong!=MUIV_List_NextSelected_End)
  525.             {
  526.                 DoMethod(App->LV_SS_Clients, MUIM_List_GetEntry, ulong, &edit_cport);
  527.                 ClientConfigToGUI(&edit_cport->clientconfig);
  528.                 set(App->WindowClientConfig,MUIA_Window_Open,TRUE);
  529.             }
  530.             break;
  531.         case GUIID_DC_SS_USERS:
  532.             ulong = MUIV_List_NextSelected_Start;
  533.             DoMethod(App->LV_SS_Users, MUIM_List_NextSelected, &ulong);
  534.             if (ulong!=MUIV_List_NextSelected_End)
  535.             {
  536.                 struct UserNode un;
  537.                 usernode=&un;
  538.                 DoMethod(App->LV_SS_Users, MUIM_List_GetEntry, ulong, &usernode);
  539.                 if (edit_udata->IDNumber)
  540.                 {
  541.                     GUIToUserData(edit_udata);
  542.                     SaveUser(edit_udata);
  543.                 }
  544.                 if (LoadUser(edit_udata,usernode->IDNumber))
  545.                 {
  546.                     UserDataToGUI(edit_udata);
  547.                     set(App->WindowUserEditor,MUIA_Window_Open,TRUE);
  548.                 }
  549.             }
  550.             break;
  551.         case GUIID_USER_CLOSEWIN:
  552.             if (edit_udata->IDNumber)
  553.             {
  554.                 if (edit_udata->IDNumber)
  555.                 {
  556.                     GUIToUserData(edit_udata);
  557.                     SaveUser(edit_udata);
  558.                 }
  559.                 edit_udata->IDNumber=0;
  560.                 set(App->WindowUserEditor,MUIA_Window_Open,FALSE);
  561.             }
  562.             break;
  563.  
  564.         /************************************************************************/
  565.         /***                                                  STRING - CASING ***/
  566.         /************************************************************************/
  567.  
  568.  
  569.         case GUIID_SS_CLIENTS_NEW:
  570.             gui_SendGUIMsg(GUIMSG_CLIENT_NEW,0);
  571.             break;
  572.         case GUIID_SS_CLIENTS_EDIT:
  573.         ulong = MUIV_List_NextSelected_Start;
  574.             DoMethod(App->LV_SS_Clients, MUIM_List_NextSelected, &edit_cport);
  575.             if (ulong!=MUIV_List_NextSelected_End)
  576.             {
  577.                 DoMethod(App->LV_SS_Clients, MUIM_List_GetEntry, ulong, &edit_cport);
  578.                 ClientConfigToGUI(&edit_cport->clientconfig);
  579.                 set(App->WindowClientConfig,MUIA_Window_Open,TRUE);
  580.             }
  581.             gui_SendGUIMsg(GUIMSG_CLIENT_EDIT,0);
  582.             break;
  583.         case GUIID_SS_CLIENTS_REMOVE:
  584.             break;
  585.         case GUIID_SS_USERS_NEW:
  586.             break;
  587.         case GUIID_SS_USERS_EDIT:
  588.             break;
  589.         case GUIID_SS_USERS_REMOVE:
  590.             break;
  591.  
  592.         case GUIID_SS_ACCEPT:
  593.             {
  594.                 struct INet_LocalMailServer *mailserver=NULL;
  595.                 gui_SendGUIMsg(GUIMSG_MPCONFIG_SAVE,0);
  596.  
  597.                 GUIToMainPortConfig(mainportconfig);
  598. //                GUIToClientConfig();
  599.  
  600.                 if (current_LocalMailServer)
  601.                     GUIToINet_LocalMailServer(current_LocalMailServer);
  602.                 if (current_MailUser)
  603.                     GUIToINet_LocalUser(current_MailUser);
  604.                 if (current_POP3Server)
  605.                     GUIToINet_POP3Server(current_POP3Server);
  606.                 if (current_event)
  607.                     GUIToEvent(current_event);
  608.  
  609. //                GUIToUserData(UserData *udata);
  610.                 
  611.                 set(App->WindowSystemService,MUIA_Window_Open,FALSE);
  612.                 SaveEvents();
  613.                 SaveMailServers();
  614.             }
  615.             break;
  616.         case GUIID_SS_CANCEL:
  617.             set(App->WindowSystemService,MUIA_Window_Open,FALSE);
  618.             break;
  619.  
  620.  
  621.         case GUIID_CL_OK:
  622.             set(App->GR_WindowClientList,MUIA_Disabled,FALSE);              // first, hide all other windows
  623.             set(App->GR_WindowClientConfig,MUIA_Disabled,FALSE);
  624.             set(App->GR_WindowSystemService,MUIA_Disabled,FALSE);
  625.             set(App->WindowLocked,MUIA_Window_Open,FALSE);
  626.             break;
  627.         case GUIID_CL_CANCEL:
  628.             set(App->GR_WindowClientList,MUIA_Disabled,FALSE);              // first, hide all other windows
  629.             set(App->GR_WindowClientConfig,MUIA_Disabled,FALSE);
  630.             set(App->GR_WindowSystemService,MUIA_Disabled,FALSE);
  631.             set(App->WindowLocked,MUIA_Window_Open,FALSE);
  632.             break;
  633.         case GUIID_NEWREGISTER:                                                 // Get new Registration-input
  634.             set(App->WindowClientList,MUIA_Disabled,TRUE);          // first, hide all other windows
  635.             set(App->WindowClientConfig,MUIA_Disabled,TRUE);
  636.             set(App->WindowSystemService,MUIA_Disabled,TRUE);
  637.             set(App->WindowRegistration,MUIA_Window_Open,TRUE);
  638.             Delay(200);
  639.             set(App->WindowClientList,MUIA_Disabled,FALSE);         // unhide all windows
  640.             set(App->WindowClientConfig,MUIA_Disabled,FALSE);
  641.             set(App->WindowSystemService,MUIA_Disabled,FALSE);
  642.             break;
  643.         case GUIID_SCREENMODE:
  644.             break;
  645.         case GUIID_CY_NETWORKCON:
  646.             get(App->CY_CC_NETWORKTYPE,MUIA_Cycle_Active,&ulong); // get actual cycle pos.
  647.             set(old_hide,MUIA_ShowMe,FALSE);                                                 // hide old group
  648.  
  649.             switch (ulong)                         /*** old_hide = new show group ***/
  650.             {
  651.                 case FD_MUI_SCONFIG_ADDRESS_LOCAL:
  652.                     old_hide=App->GR_LOCAL;
  653.                     break;                    
  654.                 case FD_MUI_SCONFIG_ADDRESS_SERIAL:
  655.                     old_hide=App->GR_SerialConfig;
  656.                     break;
  657.                 case FD_MUI_SCONFIG_ADDRESS_PARALLEL:
  658.                     old_hide=App->GR_Parallel;
  659.                     break;
  660.                 case FD_MUI_SCONFIG_ADDRESS_TCPIP:
  661.                     old_hide=App->GR_TCPIP;
  662.                     break;
  663.                 case FD_MUI_SCONFIG_ADDRESS_ENVOY:
  664.                     old_hide=App->GR_ENVOY;
  665.                     break;
  666.                 case FD_MUI_SCONFIG_ADDRESS_NOVELL:
  667.                     old_hide=App->GR_IPX;
  668.                     break;
  669.                 case FD_MUI_SCONFIG_ADDRESS_MSN:
  670.                     old_hide=App->GR_MSN;
  671.                     break;
  672.             }
  673.             set(old_hide,MUIA_ShowMe,TRUE);         // show new group
  674.         case GUIID_SS_TCP_MAILBOX_NEW:
  675.             {
  676.                 struct INet_LocalMailServer *newserver;
  677.                 if ((newserver=AllocVec(sizeof(INet_LocalMailServer),MEMF_ANY|MEMF_CLEAR)))
  678.                 {
  679.                     strcpy(newserver->Name,"NewServer");
  680.                     newserver->Status=SERVER_ADDED;
  681.                     LocalMailServers++;
  682.                     AddTail((List *)&mainportconfig->LocalMailServerList,(Node *)newserver);
  683.                     NewList((List *)&newserver->Users);
  684.                     DoMethod(App->LV_SS_TCP_MAILBOX_HOSTS, MUIM_List_Insert, &newserver, 1, MUIV_List_Insert_Bottom);
  685.                     set(App->LV_SS_TCP_MAILBOX_HOSTS,MUIA_List_Active, MUIV_List_Active_Bottom);
  686. #ifdef DEBUG
  687.                     printf("newserver: %x Empty: %d\n",newserver,IsListEmpty((List*)&newserver->Users));
  688. #endif
  689.                 }
  690.             }
  691.             break;
  692.         case GUIID_SS_TCP_MAILBOX_REMOVE:
  693.             if (current_LocalMailServer)
  694.             {
  695.                 ULONG entries;
  696.                 DoMethod(App->LV_SS_TCP_MAILBOX_HOSTS, MUIM_List_Remove,MUIV_List_Remove_Active);
  697.                 current_LocalMailServer->Status=SERVER_REMOVED;
  698.                 get(App->LV_SS_TCP_MAILBOX_HOSTS,MUIA_List_Entries,&entries);
  699.                 if (!entries)
  700.                 {
  701.                     current_LocalMailServer=NULL;
  702.                     current_MailUser=NULL;
  703.                     set(App->GR_SS_TCP_MAILBOX_PARAMETERS,MUIA_Disabled,TRUE);
  704.                 }
  705.             }
  706.             break;
  707.         case GUIID_SS_TCP_MAILBOX_NAME:
  708.             if (current_LocalMailServer)
  709.             {
  710.                 GetX(App->STR_SS_TCP_MAILBOX_NAME,current_LocalMailServer->Name,40);
  711.                 DoMethod(App->LV_SS_TCP_MAILBOX_HOSTS, MUIM_List_Redraw, MUIV_List_Redraw_Active);
  712.             }
  713.             break;
  714.         case GUIID_SS_TCP_MAILBOX_USER_NEW:
  715.             if (current_LocalMailServer)
  716.             {
  717.                 struct INet_MailUser *newuser;
  718.                 if ((newuser=AllocVec(sizeof(INet_MailUser),MEMF_ANY|MEMF_CLEAR)))
  719.                 {
  720. #ifdef DEBUG
  721.                     printf("newuser: 0x%x\n",newuser);
  722. #endif
  723. //                    LocalMailServers++;
  724.                     AddTail((List *)¤t_LocalMailServer->Users,(Node *)newuser);
  725.                     DoMethod(App->LV_SS_TCP_MAILBOX_USERS, MUIM_List_Insert, &newuser, 1, MUIV_List_Insert_Bottom);
  726.                     set(App->LV_SS_TCP_MAILBOX_USERS,MUIA_List_Active, MUIV_List_Active_Bottom);
  727.                 }
  728.             }
  729.             break;
  730.         case GUIID_SS_TCP_MAILBOX_USER_REMOVE:
  731.             if (current_MailUser)
  732.             {
  733.                 ULONG entries;
  734.                 DoMethod(App->LV_SS_TCP_MAILBOX_USERS, MUIM_List_Remove,MUIV_List_Remove_Active);
  735.                 current_MailUser->Status=USER_REMOVED;
  736.                 get(App->LV_SS_TCP_MAILBOX_USERS,MUIA_List_Entries,&entries);
  737.                 if (!entries)
  738.                 {
  739.                     current_MailUser=NULL;
  740.                     set(App->GR_SS_TCP_MAILBOX_USERS_PARAMETERS,MUIA_Disabled,TRUE);
  741.                 }
  742.             }
  743.             break;
  744.         case GUIID_SS_TCP_MAILBOX_USER_CHANGENAME:
  745. #ifdef DEBUG
  746.             printf("change username\n");
  747. #endif
  748.             if (current_MailUser)
  749.             {
  750.                 GetX(App->STR_SS_TCP_MAILBOX_NAME,current_MailUser->Name,40);
  751.                 DoMethod(App->LV_SS_TCP_MAILBOX_USERS,MUIM_List_Redraw, MUIV_List_Redraw_Active);
  752.             }        
  753.             break;
  754.         case GUIID_SS_TCP_MAILBOX_USERSELECT_DC:
  755.             if (current_MailUser)
  756.             {
  757.                 struct UserNode *udata=NULL;
  758.                 ULONG ulong = MUIV_List_GetEntry_Active;
  759. //                DoMethod(App->LV_SS_TCP_MAILBOX_USERS_NAME, MUIM_List_NextSelected, &ulong);
  760. #ifdef DEBUG
  761.                 printf("u1\n");
  762. #endif
  763. //                if (ulong!=MUIV_List_NextSelected_End)
  764.                 {
  765.                     DoMethod(App->LV_SS_TCP_MAILBOX_USERS_NAME, MUIM_List_GetEntry, ulong, &udata);
  766. #ifdef DEBUG
  767.                     printf("u2\n");
  768. #endif
  769.                     if (udata)
  770.                     {
  771.                         strncpy(current_MailUser->Name,udata->Handle,21);
  772.                         set(App->STR_PO_SS_TCP_MAILBOX_USERS_NAME,MUIA_String_Contents,udata->Handle);
  773. //                        DoMethod(App->LV_SS_TCP_MAILBOX_USERS,MUIM_List_Redraw, MUIV_List_Redraw_Active);
  774.                         set(App->GR_SS_TCP_MAILBOX_USERS_NAME,MUIA_ShowMe,FALSE);
  775. //                        DoMethod(App->GR_SS_TCP_MAILBOX_USERS_NAME, MUIM_Hide);
  776.                     }
  777.                 }
  778.             }
  779.  
  780.             break;
  781.         case GUIID_SS_TCP_MAILBOX_CHANGEHOST:
  782.             if (current_LocalMailServer)
  783.             {
  784.                 GetX(App->STR_SS_TCP_MAILBOX_NAME,current_LocalMailServer->Name,40);
  785.                 DoMethod(App->LV_SS_TCP_MAILBOX_HOSTS,MUIM_List_Redraw, MUIV_List_Redraw_Active);
  786.             }
  787.             break;
  788.         case GUIID_SS_TCP_POP3_NEW:
  789.             {
  790.                 struct INet_POP3Server *newserver;
  791.                 if ((newserver=AllocVec(sizeof(INet_POP3Server),MEMF_ANY|MEMF_CLEAR)))
  792.                 {
  793.                     strcpy(newserver->Name,"NewServer");
  794.                     newserver->Status=SERVER_ADDED;
  795.                     POP3Servers++;
  796.                     AddTail((List *)&mainportconfig->POP3ServerList,(Node *)newserver);
  797.                     DoMethod(App->LV_SS_TCP_POP_HOSTS, MUIM_List_Insert, &newserver, 1, MUIV_List_Insert_Bottom);
  798.                     set(App->GR_SS_TCP_POP_PARA,MUIA_Disabled,FALSE);
  799.                     set(App->LV_SS_TCP_POP_HOSTS,MUIA_List_Active, MUIV_List_Active_Bottom);
  800.                 }
  801.             }
  802.             break;
  803.         case GUIID_SS_TCP_POP3_REMOVE:
  804.             if (current_POP3Server)
  805.             {
  806.                 ULONG entries;
  807.                 DoMethod(App->LV_SS_TCP_POP_HOSTS, MUIM_List_Remove,MUIV_List_Remove_Active);
  808.                 current_POP3Server->Status=SERVER_REMOVED;
  809.                 get(App->LV_SS_TCP_POP_HOSTS,MUIA_List_Entries,&entries);
  810.                 if (!entries)
  811.                 {
  812.                     current_POP3Server=NULL;
  813.                     set(App->GR_SS_TCP_POP_PARA,MUIA_Disabled,TRUE);
  814.                 }
  815.             }
  816.             break;
  817.         case GUIID_SS_TCP_POP3_CHANGEHOST:
  818.             if (current_POP3Server)
  819.             {
  820.                 GetX(App->STR_SS_TCP_POP_NAME,current_POP3Server->Name,40);
  821.                 DoMethod(App->LV_SS_TCP_POP_HOSTS,MUIM_List_Redraw, MUIV_List_Redraw_Active);
  822.             }
  823.             break;
  824.         case GUIID_SS_BASE_OPEN: case GUIID_SS_BASE_SELECT:
  825.             {
  826.                 struct ItemHeader *header;
  827.                 ulong = MUIV_List_NextSelected_Start;
  828.                 for (;;)
  829.                 {
  830.                     DoMethod(App->LV_SS_BASEVIEW, MUIM_List_NextSelected, &ulong);
  831.                     if (ulong == MUIV_List_NextSelected_End) break;
  832.                     DoMethod(App->LV_SS_BASEVIEW, MUIM_List_GetEntry, ulong, &header);
  833.                 }
  834.                 if (header)
  835.                 {
  836.                     if (header->ItemType==ITEMTYPE_SUBBOARD)
  837.                     {
  838.                         if (header->Path)
  839.                         {
  840.                             strcpy(buffer,header->Path);
  841.                             DoMethod(App->LV_SS_BASEVIEW, MUIM_List_Clear);
  842.                             UpdateBaselist(buffer);
  843.                         }
  844.                     }
  845.                     else
  846.                     {
  847.                         if (header->ItemType==ITEMTYPE_ITEM)
  848.                             Read_Subboard(header);
  849.                     }
  850.                 }
  851.             }
  852.             break;
  853.         case GUIID_SS_BASE_EDIT:
  854.             break;
  855.         case GUIID_SS_BASE_NEW:
  856.             break;
  857.         case GUIID_SS_BASE_REMOVE:
  858.             break;
  859.         case GUIID_SS_BASE_PARENT:
  860.             ParrentBaselist();
  861.             break;
  862.         case GUIID_REMINDER_NEW:
  863.             {
  864.                 struct Event *newevent;
  865.                 if ((newevent=AllocVec(sizeof(Event),MEMF_ANY|MEMF_CLEAR)))
  866.                 {
  867.                     GetTime(&actualdate);
  868.                     strcpy(newevent->Name,"NewEvent");
  869.                     CopyMemQuick(&actualdate,&newevent->BeginDate,sizeof(Date));
  870.                     CopyMemQuick(&actualdate,&newevent->EndDate,sizeof(Date));
  871.                     newevent->Multiplicator=MULTIPLICATOR_MINS;
  872.                     newevent->IntervalTime=10;
  873.                     AddTail((List *)&mainportconfig->EventList,(Node *)newevent);
  874.                     DoMethod(App->LV_REMINDER, MUIM_List_Insert, &newevent, 1, MUIV_List_Insert_Bottom);
  875.                     set(App->LV_REMINDER,MUIA_List_Active, MUIV_List_Active_Bottom);
  876.                 }
  877.             }
  878.             break;
  879.         case GUIID_REMINDER_COPY:
  880.             {
  881.                 struct Event *newevent;
  882.                 if ((newevent=AllocVec(sizeof(Event),MEMF_ANY|MEMF_CLEAR)))
  883.                 {
  884.                     CopyMemQuick(current_event,newevent,sizeof(Event));
  885.                     ClearMemQuick(&newevent->LastEvent,sizeof(Date));
  886.                     ClearMemQuick(&newevent->NextEvent,sizeof(Date));
  887.                     newevent->Running=FALSE;
  888.                     newevent->init=FALSE;
  889.                     AddTail((List *)&mainportconfig->EventList,(Node *)newevent);
  890.                     DoMethod(App->LV_REMINDER, MUIM_List_Insert, &newevent, 1, MUIV_List_Insert_Bottom);
  891.                     set(App->LV_REMINDER,MUIA_List_Active, MUIV_List_Active_Bottom);
  892.                 }
  893.             }
  894.             break;
  895.         case GUIID_REMINDER_ADD:
  896.             break;
  897.         case GUIID_REMINDER_TEST:
  898.             if (current_event)
  899.                 ExecuteEvent(current_event);
  900.             break;
  901.         case GUIID_REMINDER_UPDATE:
  902.             break;
  903.         case GUIID_REMINDER_REMOVE:
  904.             if (current_event)
  905.             {
  906.                 ULONG entries;
  907.                 DoMethod(App->LV_REMINDER, MUIM_List_Remove,MUIV_List_Remove_Active);
  908.                 get(App->LV_REMINDER,MUIA_List_Entries,&entries);
  909.                 if (!entries)
  910.                     current_event=NULL;
  911.             }
  912.             break;
  913.         case GUIID_REMINDER_NAME:
  914.             if (current_event)
  915.             {
  916.                 GetX(App->STR_REMINDER,current_event->Name,20);
  917.                 DoMethod(App->LV_REMINDER, MUIM_List_Redraw, MUIV_List_Redraw_Active);
  918.             }
  919.             break;
  920.         case GUIID_REMINDER_INTERVALTYPE:
  921.             get(App->CY_REMINDER_INTERVALTYPE,MUIA_Cycle_Active,&ulong);
  922.             switch (ulong)
  923.             {
  924.                 case 0:
  925.                     if (!reminder_interval)
  926.                     {
  927.                         set(App->STR_REMINDER_ENDTIME,MUIA_Disabled,FALSE);
  928.                         set(App->STR_REMINDER_INTERVAL,MUIA_Disabled,FALSE);
  929.                         reminder_interval=TRUE;
  930.                     }
  931.                     break;
  932.                 case 1:
  933.                     if (reminder_interval)
  934.                     {
  935.                         set(App->STR_REMINDER_ENDTIME,MUIA_Disabled,TRUE);
  936.                         set(App->STR_REMINDER_INTERVAL,MUIA_Disabled,TRUE);
  937.                         reminder_interval=FALSE;
  938.                     }
  939.                     break;
  940.             }
  941.             break;
  942.         case GUIID_REMINDER_HOLIDAYS:
  943.             get(App->CY_REMINDER_HOLIDAYS,MUIA_Cycle_Active,&ulong);
  944.             switch (ulong)
  945.             {
  946.                 case 0:
  947.                     break;
  948.                 case 1:
  949.                     break;
  950.             }
  951.             break;
  952.             break;
  953.         case GUIID_REMINDER_DATETYPE:
  954.             get(App->CY_REMINDER_DATETYPE,MUIA_Cycle_Active,&ulong);
  955.             switch (ulong)
  956.             {
  957.                 case 0:            // Date
  958.                     GroupRemMonth();
  959.                     GroupAddDate();
  960.                     if (datetype_space)
  961.                     {
  962.                         set(App->STR_REMINDER_ENDDATE,MUIA_Disabled,TRUE);
  963.                         datetype_space=FALSE;
  964.                     }
  965.                     break;
  966.                 case 1:            // Space
  967.                     GroupRemMonth();
  968.                     GroupAddDate();
  969.                     if (!datetype_space)
  970.                     {
  971.                         set(App->STR_REMINDER_ENDDATE,MUIA_Disabled,FALSE);
  972.                         datetype_space=TRUE;
  973.                     }
  974.                     break;
  975.                 case 2:            // Month
  976.                     GroupRemDate();
  977.                     GroupAddMonth();
  978.                     break;
  979.                 case 3:            // Daily
  980.                     GroupRemDate();
  981.                     GroupRemMonth();
  982.                     break;
  983.             }
  984.             break;
  985.             break;
  986.         }}
  987.  
  988.  
  989.         /***************************************/
  990.         /***  MESSAGES                       ***/
  991.         /***************************************/
  992.  
  993.         if (running && signal && !msg) Wait(signal|(1<<GUIPort->mp_SigBit));    // Waiting of Signals
  994.         msg=(GUIMsg *)GetMsg(GUIPort);
  995.         if (msg)
  996.         {
  997.             switch (msg->cmdid)
  998.             {
  999.             case GUIMSG_REPLY:                                      // Std-Reply
  1000.                 FreeGUIMsg(msg);
  1001.                 break;
  1002.             case GUIMSG_CLOSE_FRONT_END:            // Normal Programmend
  1003.                 ReturnGUIMsg(msg);
  1004.                 running = FALSE;
  1005.                 break;
  1006.             case GUIMSG_CLOSE_FAIL20:                       // Main Port failat. CloseIt NOW!!!
  1007.                 ReturnGUIMsg(msg);
  1008.                 running = FALSE;
  1009.                 break;
  1010.             case GUIMSG_CLIENT_ADD:                         // Add Client, from MainPort
  1011.                 if (msg->data)
  1012.                 {
  1013.                     DoMethod(App->LV_Client_List, MUIM_List_Insert, &msg->data, 1, MUIV_List_Insert_Bottom);
  1014.                     DoMethod(App->LV_SS_Clients, MUIM_List_Insert, &msg->data, 1, MUIV_List_Insert_Bottom);
  1015.                 }
  1016.                 ReturnGUIMsg(msg);
  1017.                 break;
  1018.             case GUIMSG_CLIENT_REMOVE:
  1019.                 quit=FALSE;
  1020.                 for (counter=0;(!quit && counter<numberofclients); counter++)
  1021.                 {
  1022.                     DoMethod(App->LV_Client_List, MUIM_List_GetEntry, counter, &cport2);
  1023.                     if (mport==(PortData *)msg->data)quit=TRUE;
  1024.                 }
  1025.                 if (quit && cport2)
  1026.                 {
  1027.                     DoMethod(App->LV_Client_List, MUIM_List_Remove, counter);
  1028.                     DoMethod(App->LV_SS_Clients, MUIM_List_Remove, counter);
  1029.                 }
  1030.                 ReturnGUIMsg(msg);
  1031.                 break;  
  1032.             case GUIMSG_CLIENT_CHANGE:
  1033.                 quit=FALSE;
  1034.                 for (counter=0;(!quit && counter<numberofclients); counter++)
  1035.                 {
  1036.                     DoMethod(App->LV_Client_List, MUIM_List_GetEntry, counter, &cport2);
  1037.                     if (mport==(PortData *)msg->data)quit=TRUE;
  1038.                 }
  1039.                 if (quit && cport2)
  1040.                 {
  1041.                     DoMethod(App->LV_Client_List, MUIM_List_Redraw, counter);
  1042.                     DoMethod(App->LV_SS_Clients, MUIM_List_Redraw, counter);
  1043.                 }
  1044.                 ReturnGUIMsg(msg);
  1045.                 break;
  1046.             case GUIMSG_CLIENTLIST_REFRESH:
  1047.                 nc=(PortData2 *)client_list->lh_Head;
  1048.                 while (nc->port_node.ln_Succ)
  1049.                 {
  1050.                     DoMethod(App->LV_Client_List, MUIM_List_Insert, &nc->port_address, 1, MUIV_List_Insert_Bottom);
  1051.                     DoMethod(App->LV_SS_Clients, MUIM_List_Insert, &nc->port_address, 1, MUIV_List_Insert_Bottom);
  1052.                     nc=(PortData2 *)nc->port_node.ln_Succ;
  1053.                 }
  1054.                 ReturnGUIMsg(msg);
  1055.                 break;
  1056.             case GUIMSG_CLIENT_EDIT:
  1057.                 edit_cport=msg->data;
  1058.                 ReturnGUIMsg(msg);
  1059.                 ClientConfigToGUI(&edit_cport->clientconfig);
  1060.                 set(App->WindowClientConfig,MUIA_Window_Open,TRUE);
  1061.                 break;
  1062.             case GUIMSG_ABOUT:
  1063.                 ReturnGUIMsg(msg);
  1064.             MUI_RequestA(App->App, 0, 0,"System Request","_Ok",
  1065.                 "NOVIA, Boud Bandit Software. V 0.00.06alpha \nCopyright ©1996-1999 by Thorsten Gehler/UFoP\nFrom: "__DATE__" "__TIME__,0);
  1066.                 break;
  1067.             case GUIMSG_QUIT:
  1068.                 ReturnGUIMsg(msg);
  1069.             if (MUI_RequestA(App->App, 0, 0,"System Request", "_Ok|_Cancel","Really Shutdown \nNoViA BBS System",0))
  1070.                 gui_SendGUIMsg(GUIMSG_CLOSE_MAINPORT,0);                        
  1071.                 break;
  1072.             case GUIMSG_LOCKCONSULE:
  1073.                 ReturnGUIMsg(msg);
  1074.                 set(App->GR_WindowClientList,MUIA_Disabled,TRUE);               // first, hide all other windows
  1075.                 set(App->GR_WindowClientConfig,MUIA_Disabled,TRUE);
  1076.                 set(App->GR_WindowSystemService,MUIA_Disabled,TRUE);
  1077.                 set(App->WindowLocked,MUIA_Window_Open,TRUE);
  1078.                 break;
  1079.             case GUIMSG_REDRAW_REMINDERLIST:
  1080.                 DoMethod(App->LV_REMINDER, MUIM_NList_Redraw, MUIV_NList_Redraw_All);
  1081.                 ReturnGUIMsg(msg);
  1082.                 break;
  1083.             }
  1084.         }
  1085.      }
  1086.     gui_CloseIt(0,"");
  1087. }
  1088.  
  1089. void RemoveEntry_List(struct List *list)
  1090. {
  1091.     ClearEntry_List(list);
  1092.     FreeVec(list);
  1093. }
  1094.  
  1095. void ClearEntry_List(struct List *list)
  1096. {
  1097.     Node *nc;
  1098.     if (!list)return;
  1099.     nc=list->lh_Head;
  1100.     while(!IsListEmpty(list))
  1101.     {
  1102.         Remove(nc);
  1103.         FreeVec(nc);
  1104.         nc=list->lh_Head;
  1105.     }
  1106.     NewList(list);
  1107. }
  1108.  
  1109. void RedrawEventList()
  1110. {
  1111.     DoMethod(App->LV_REMINDER, MUIM_NList_Redraw, MUIV_NList_Redraw_All);
  1112. }
  1113.  
  1114. #include "gui/novia_gui_hooks.c"
  1115. #include "gui/novia_gui_helpfuncs.c"
  1116.  
  1117.  
  1118.  
  1119. void GroupAddDate()
  1120. {
  1121. /*    if (!App->GR_REMINDER_DATETYPE_DATE)
  1122.     {
  1123.         App->GR_REMINDER_DATETYPE_DATE = GroupObject,
  1124. //            MUIA_Frame, MUIV_Frame_Group,
  1125.             MUIA_Group_Horiz, TRUE,
  1126.             Child, Label2("beginn"),
  1127.             Child, App->STR_REMINDER_BEGINDATE = StringObject,
  1128.                 MUIA_Frame, MUIV_Frame_String,
  1129.                 MUIA_String_MaxLen, 16,
  1130.             End,
  1131.             Child, Label2("end"),
  1132.             Child, App->STR_REMINDER_ENDDATE = StringObject,
  1133.                 MUIA_Frame, MUIV_Frame_String,
  1134.                 MUIA_String_MaxLen, 16,
  1135.             End,
  1136.             Child, HVSpace,
  1137.         End;
  1138.         if (App->GR_REMINDER_DATETYPE_DATE)
  1139.         {
  1140.             DoMethod(App->GR_grp_95, OM_ADDMEMBER, App->GR_REMINDER_DATETYPE_DATE);
  1141. //            DoMethod(App->GR_grp_95, OM_UPDATE, App->GR_REMINDER_DATETYPE_DATE);
  1142.             MUI_Redraw(App->App,MADF_DRAWOBJECT);
  1143. //            set(App->GR_REMINDER_DATETYPE_DATE,MUIA_ShowMe,FALSE);     // show SerialConfig 
  1144. //            set(App->GR_REMINDER_DATETYPE_DATE,MUIA_ShowMe,TRUE);     // show SerialConfig 
  1145.         }
  1146.     }
  1147. */
  1148.     if (!grp_date)
  1149.     {
  1150.         set(App->GR_REMINDER_DATETYPE_DATE,MUIA_Disabled,FALSE);
  1151.         grp_date=TRUE;
  1152.     }
  1153. }
  1154.  
  1155. void GroupRemDate()
  1156. {
  1157. /*    if (App->GR_REMINDER_DATETYPE_DATE)
  1158.     {
  1159.         DoMethod(App->GR_grp_95, OM_REMMEMBER, App->GR_REMINDER_DATETYPE_DATE);
  1160. //        MUI_DisposeObject(App->GR_REMINDER_DATETYPE_DATE);
  1161.         App->GR_REMINDER_DATETYPE_DATE=NULL;
  1162.     }*/
  1163.     if (grp_date)
  1164.     {
  1165.         set(App->GR_REMINDER_DATETYPE_DATE,MUIA_Disabled,TRUE);
  1166.         grp_date=FALSE;
  1167.     }
  1168. }
  1169.  
  1170. void GroupAddMonth()
  1171. {
  1172. /*
  1173.     if (!App->GR_REMINDER_DATETYPE_MONTHLY)
  1174.     {
  1175.         App->GR_REMINDER_DATETYPE_MONTHLY = GroupObject,
  1176. //            MUIA_Frame, MUIV_Frame_Group,
  1177.             MUIA_Group_Horiz, TRUE,
  1178.             Child, GroupObject,
  1179.                 MUIA_Group_Columns, 2,
  1180.                 Child, Label2("1st"),
  1181.                 Child, App->CH_REMINDER1 = CheckMark(FALSE),
  1182.             End,
  1183.             Child, GroupObject,
  1184.                 MUIA_Group_Columns, 2,
  1185.                 Child, Label2("2nd"),
  1186.                 Child, App->CH_REMINDER2 = CheckMark(FALSE),
  1187.                 End,
  1188.             Child, GroupObject,
  1189.                 MUIA_Group_Columns, 2,
  1190.                 Child, Label2("3rd"),
  1191.                 Child, App->CH_REMINDER3 = CheckMark(FALSE),
  1192.                 End,
  1193.             Child, GroupObject,
  1194.                 MUIA_Group_Columns, 2,
  1195.                 Child, Label2("4th"),
  1196.                 Child, App->CH_REMINDER4 = CheckMark(FALSE),
  1197.                 End,
  1198.             Child, GroupObject,
  1199.                 MUIA_Group_Columns, 2,
  1200.                 Child, Label2("5th"),
  1201.                 Child, App->CH_REMINDER5 = CheckMark(FALSE),
  1202.                 End,
  1203.             Child, GroupObject,
  1204.                 MUIA_Group_Columns, 2,
  1205.                 Child, Label2("6th"),
  1206.                 Child, App->CH_REMINDER6 = CheckMark(FALSE),
  1207.                 End,
  1208.             Child, GroupObject,
  1209.                 MUIA_Group_Columns, 2,
  1210.                 Child, Label2("7th"),
  1211.                 Child, App->CH_REMINDER7 = CheckMark(FALSE),
  1212.                 End,
  1213.             Child, GroupObject,
  1214.                 MUIA_Group_Columns, 2,
  1215.                 Child, Label2("8th"),
  1216.                 Child, App->CH_REMINDER8 = CheckMark(FALSE),
  1217.                 End,
  1218.             Child, GroupObject,
  1219.                 MUIA_Group_Columns, 2,
  1220.                 Child, Label2("9th"),
  1221.                 Child, App->CH_REMINDER9 = CheckMark(FALSE),
  1222.                 End,
  1223.             Child, GroupObject,
  1224.                 MUIA_Group_Columns, 2,
  1225.                 Child, Label2("10th"),
  1226.                 Child, App->CH_REMINDER10 = CheckMark(FALSE),
  1227.                 End,
  1228.             Child, GroupObject,
  1229.                 MUIA_Group_Columns, 2,
  1230.                 Child, Label2("11th"),
  1231.                 Child, App->CH_REMINDER11 = CheckMark(FALSE),
  1232.                 End,
  1233.             Child, GroupObject,
  1234.                 MUIA_Group_Columns, 2,
  1235.                 Child, Label2("12th"),
  1236.                 Child, App->CH_REMINDER12 = CheckMark(FALSE),
  1237.                 End,
  1238.             Child, HVSpace,
  1239.         End;
  1240.         if (App->GR_REMINDER_DATETYPE_MONTHLY)
  1241.         {
  1242.             DoMethod(App->GR_grp_95, OM_ADDMEMBER, App->GR_REMINDER_DATETYPE_MONTHLY);
  1243. //            DoMethod(App->GR_grp_95, OM_UPDATE, App->GR_REMINDER_DATETYPE_MONTHLY);
  1244. //            MUI_Redraw(App->GR_REMINDER_DATETYPE_MONTHLY,MADF_DRAWOBJECT);
  1245. //            set(App->GR_REMINDER_DATETYPE_MONTHLY,MUIA_ShowMe,FALSE);     // show SerialConfig 
  1246. //            set(App->GR_REMINDER_DATETYPE_MONTHLY,MUIA_ShowMe,TRUE);     // show SerialConfig 
  1247.         }
  1248.     }*/
  1249.     if (!grp_month)
  1250.     {
  1251.         set(App->GR_REMINDER_DATETYPE_MONTHLY,MUIA_Disabled,FALSE);
  1252.         grp_month=TRUE;
  1253.     }
  1254. }
  1255.  
  1256.  
  1257.  
  1258. void GroupRemMonth()
  1259. {
  1260. /*    if (App->GR_REMINDER_DATETYPE_MONTHLY)
  1261.     {
  1262.         DoMethod(App->GR_grp_95, OM_REMMEMBER, App->GR_REMINDER_DATETYPE_MONTHLY);
  1263. //        MUI_DisposeObject(App->GR_REMINDER_DATETYPE_MONTHLY);
  1264.         App->GR_REMINDER_DATETYPE_MONTHLY=NULL;
  1265.     }*/
  1266.     if (grp_month)
  1267.     {
  1268.         set(App->GR_REMINDER_DATETYPE_MONTHLY,MUIA_Disabled,TRUE);
  1269.         grp_month=FALSE;
  1270.     }
  1271. }
  1272.